package com.chukun.flink.dataset.operator;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;

/**
 * @author chukun
 * @version 1.0.0
 * @description union 操作符的基本操作
 * @createTime 2022年05月28日 20:35:00
 */
public class UnionOperator {

    public static void main(String[] args) throws Exception {

        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

        DataSource<Long> dataSource01 = env.generateSequence(1, 5);

        DataSource<Long> dataSource02 = env.generateSequence(1001, 1005);

        DataSet<Long> union = dataSource01.union(dataSource02);

        union.print("union");

        env.execute("UnionOperator");
    }
}
